package com.xin.di.uav.applet.resp;

import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@EqualsAndHashCode(callSuper = true)
@Data
public class GoodsResponse extends BasePageResp {
    @Schema(description = "投放点名称")
    private String deliveryPointName;

    private BigDecimal expressFee;

    @Schema(description = "顶部走马灯文案")
    private String topNoticeTxt;

    @ApiModelProperty("配送时长")
    private Integer expressDuration;


    @Schema(description = "商家列表")
    private List<BusinessResponse> businessResponseList;


    @Data
    public static class BusinessResponse {
        private String id; // UUID主键

        @Schema(description = "商家名称")
        private String name;


        @Schema(description = "商家logo")
        private String logo;

        @Schema(description = "第一个商家的商品列表")
        private List<GoodsInfoResponse> goodsResponseList = new ArrayList<>();
    }

    @Data
    public static class GoodsInfoResponse {

        private String id; // UUID主键
        @Schema(description = "商品名称")
        private String name;
        @Schema(description = "商品主图")
        private String mainImage;
        @Schema(description = "库存")
        private Integer stock;

        private BigDecimal salePrice; // 销售价格(元)


        private List<SpecificationResp> specificationRespList;

    }

    @Data
    public static class SpecificationResp {
        private String id;

        /**
         * 产品ID
         */
        private String productId;

        /**
         * 规格类型
         */
        private Integer type;

        /**
         * 规格值
         */
        private String value;


        private String value2;

        private String value3;

        private String value4;
        private String value5;
        /**
         * 价格
         */
        private BigDecimal price;

        /**
         * 描述
         */
        private String description;

        private BigDecimal salePrice;

        private BigDecimal supplyPrice;

        /**
         * 所属商家ID
         */
        private String merchantId;

        /**
         * 创建时间
         */
        private Date createdAt;

        /**
         * 更新时间
         */
        private Date updatedAt;

        private Integer stock;
    }
}
